package converthelp

import "math/big"

func AnyToBigInt(i interface{}) (value *big.Int) {
	value = new(big.Int)
	switch v := i.(type) {
	case string:
		value, _ = value.SetString(v, 10)
		break
	case big.Int:
		value = &v
		break
	case *big.Int:
		value = v
		break
	case int:
		value.SetInt64(int64(v))
		break
	case int64:
		value.SetInt64(v)
		break
	}
	return
}
